﻿<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<AutomationHost.Models.ProductTree>" %>
<ul id="products" class="productstree">
    <%
        foreach (var product in Model.Products)
        { %>
    <li>
        <div>
            <img src="/Content/Product/<%=product.Icon %>" width="20px" height="20px" />
            <a href="/Plan/Home?productid=<%=product.ID.ToString() %>">
                <%=product.Name %>
            </a>
        </div>
        <ul>
            <%foreach (var feature in product.Features)
              { %>
            <li><a href="/Plan/Home?featureid=<%=feature.ID.ToString() %>">
                <%=feature.Name %></a>
                <ul>
                    <%foreach (var tc in feature.TestCasesModel)
                      { %>
                    <li><a href="/Plan/Home?caseid=<%=tc.ID.ToString() %>">
                        <%=tc.Name %></a></li>
                    <%} %>
                </ul>
            </li>
            <%} %>
        </ul>
    </li>
    <%} %>
</ul>
<link href="../../Content/jquery.treeview.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="../../Scripts/jquery.treeview.js"></script>
<script type="text/javascript">
    $(document).ready(function () {
        $("#products").treeview();
    });
</script>
